<template>
  <div>
    <Navbar :title="title" />
    <div class="custo-main">
      <van-search
        v-model="value"
        shape="round"
        input-align="center"
        placeholder="热搜产品:Mistine"
      />

      <div class="skin">
        <div class="skin-tag">
          <div :class="{ action: skin }" class="tag-left" @click="action">
            肤质近况
          </div>
          <div :class="{ action: !skin }" class="tag-right" @click="action">
            了解度{{ percentage }}
          </div>
        </div>
        <div class="skin-main">
          <div v-show="skin" class="skinmainone">
            <table>
              <tr>
                <td>
                  <b>85</b>
                  <p>综合得分</p>
                </td>
                <td>
                  <b>油性</b>
                  <p>出油情况</p>
                </td>
                <td>
                  <b>蛋壳</b>
                  <p>光滑度</p>
                </td>
                <td>
                  <b>比较耐受</b>
                  <p>耐受/敏感性</p>
                </td>
              </tr>
              <tr>
                <td>
                  <b>中度</b>
                  <p>黑眼圈</p>
                </td>
                <td>
                  <b>无</b>
                  <p>痘痘</p>
                </td>
                <td>
                  <b>轻度</b>
                  <p>黑头</p>
                </td>
                <td>
                  <b>细致</b>
                  <p>毛孔</p>
                </td>
              </tr>
            </table>
            <p>
              根据9月13日-9月13日的1条检测记录生成
              <img
                src="http://10.31.169.37:3000/images/定制/？号灰色.png"
                alt=""
              />
            </p>
          </div>
          <div v-show="!skin" class="skinmaintwo"></div>
        </div>
      </div>
      <div class="skin-need morewidth">
        <h1>{{ need.title }}</h1>
        <van-grid icon-size="60px" :column-num="3" :border="false">
          <van-grid-item
            :icon="geturl(key)"
            v-for="(item, key) in need.result"
            :key="key"
            :text="item"
          />
        </van-grid>
      </div>
      <div class="skin-need">
        <h1>{{ type.title }}</h1>
        <van-grid icon-size="60px" :border="false">
          <van-grid-item
            :icon="geturl(key)"
            v-for="(item, key) in type.result"
            :key="key"
            :text="item"
          />
        </van-grid>
      </div>
      <div class="skin-need">
        <h1>{{ custo.title }}</h1>
        <van-grid icon-size="60px" :border="false">
          <van-grid-item
            :icon="geturl(key)"
            v-for="(item, key) in custo.result"
            :key="key"
            :text="item"
          />
        </van-grid>
      </div>

      <div class="skin-detail">
        <h1>-精品库新品-</h1>
        <van-grid icon-size="80px" :column-num="3" :border="false">
          <van-grid-item
            :icon="geturl(item.url)"
            v-for="(item, index) in list"
            :key="index"
            :text="item.title"
            @click="todetail"
          />
        </van-grid>
      </div>
    </div>
  </div>
</template>

<script>
import Navbar from "../Navbar";
import { Search, Grid, GridItem } from "vant";
export default {
  data() {
    return {
      title: "定制",
      value: "",
      skin: true,
      percentage: "57%",
      need: {
        title: "需求定制",
        result: {
          白成一道光: "白成一道光",
          年年十八岁: "年年十八岁",
          太阳: "逃离月球表面",
          鼻子: "干掉草莓鼻",
          水滴: "我要水光肌",
          脸: " 拜拜啦敏感",
        },
      },
      type: {
        title: "按类选择",
        result: {
          卸妆: "卸妆",
          洁面: "洁面",
          护肤水: "护肤水",
          眼部: "眼部",
          精华: "精华",
          乳液: "乳液·面霜",
          防晒: "防晒",
          面膜: "面膜",
          清洁面膜: "清洁面膜",
          美容仪器: "美容仪器",
        },
      },
      custo: {
        title: "医美定制",
        result: {
          美白淡斑: "美白淡斑",
          祛痘去闭口: "祛痘去闭口",
          去黑头: "去黑头",
          抗初老: "抗初老",
          抗衰除皱: "抗衰除皱",
          舒敏去红: "舒敏去红",
          眼部问题: "眼部问题",
          缩毛孔: "缩毛孔",
        },
      },
      list: [
        {
          url: "产品",
          title: "韩束紧致抗皱抗衰老高机能面霜",
        },
        {
          url: "产品",
          title: "韩束紧致抗皱抗衰老高机能面霜",
        },
        {
          url: "产品",
          title: "韩束紧致抗皱抗衰老高机能面霜",
        },
        {
          url: "产品",
          title: "韩束紧致抗皱抗衰老高机能面霜",
        },
        {
          url: "产品",
          title: "韩束紧致抗皱抗衰老高机能面霜",
        },
        {
          url: "产品",
          title: "韩束紧致抗皱抗衰老高机能面霜",
        },
      ],
    };
  },
  activated() {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    action() {
      this.skin = !this.skin;
    },
    geturl(i) {
      return "http://10.31.169.37:3000/images/定制/" + i + ".png";
    },
    todetail() {
      this.$router.push({
        path: "detail",
      });
    },
  },
  components: {
    Navbar,
    VanSearch: Search,
    vanGridItem: GridItem,
    vanGrid: Grid,
  },
};
</script>
<style lang="less" scoped>
@import "../../assets/css/var.less";
.custo-main {
  width: 100%;
  position: fixed;
  top: 47px;
  background: #fff;
  padding: 0 20px;
  overflow: auto;
  .content();
}

.action::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 3px;
  background: #fff;
  bottom: 3px;
  left: 50%;
  transform: translate(-50%);
}

.van-search {
  padding: 10px 0;
}

.skin {
  margin: 10px 0;
  .skin-tag {
    display: flex;
    justify-content: space-between;
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    div {
      width: 49.5%;
      background: rgb(217, 239, 241);
      height: 50px;
      text-align: center;
      line-height: 50px;
      color: rgb(127, 198, 199);
      font-size: 17px;
      position: relative;
    }
    .action {
      background: rgb(127, 198, 199);
      color: #fff;
    }
    .action::after {
      content: "";
      position: absolute;
      width: 30px;
      height: 3px;
      background: #fff;
      bottom: 3px;
      left: 50%;
      transform: translate(-50%);
    }
  }
  .skin-main {
    margin-top: 3px;
    div {
      width: 100%;
      height: 180px;
    }
    .skinmainone {
      background: rgb(239, 249, 250);
      table {
        width: 91%;
        height: 124px;
        margin-left: 10px;
        td {
          text-align: center;
          b {
            font-size: 18px;
            font-weight:500;
          }
          p {
            margin-top: 5px;
            
          }
        }
      }
      p {
        margin-top: 20px;
        text-align: center;
        color: rgb(146, 146, 146);
        font-size: 15px;
        font-weight: 300;
        img {
          width: 20px;
          height: 20px;
          vertical-align: middle;
        }
      }
    }
    .skinmaintwo {
      background: url("http://10.31.169.37:3000/images/定制/图层 1.png")
        no-repeat left/ 100% auto;
    }
  }
}
.skin-detail {
  text-align: center;
  h1 {
    font-size: 16px;
    margin-top: 10px;
  }
}
.skin-need {
  h1 {
    font-size: 20px;
    font-weight: 0;
  }
  ul {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-bottom: 20px;
    li {
      width: 33%;
      text-align: center;
      font-size: 15px;
      img {
        width: 100%;
        padding: 17px;
      }
    }
  }
}
</style>
